/*
 * @Description: 
 * @Author: Aroma
 * @Date: 2024-10-09 20:44:36
 * @LastEditors: Aroma
 * @LastEditTime: 2024-10-09 20:44:40
 * @别瞎看: 你个无脑牛马
 */

/**
 * ReturnExceptionDemo
 */
public class ReturnExceptionDemo {
    public static void methodA() throws Exception
    {
        try{
            System.out.println("进入方法A");
            throw new Exception("抛出异常");
        }finally{
            System.out.println("方法A finally");
        }
    }
    public static int methodB(){
        try{
            System.out.println("进入方法B");
            return 1;
        }finally{
            System.out.println("方法B finally");
            return 2;
        }
    }
    public static void main(String[] args){
        try{
            methodA();
        }catch(Exception e){
            System.out.println("main方法捕获到异常"+e.getMessage());
        }
        int i = methodB();
        System.out.println("main方法返回："+i);
    }
}